Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions / Tearing Down a Connection


OTRcvOrderlyDisconnect

Acknowledges a request for an orderly disconnect.

C INTERFACE
OSStatus OTRcvOrderlyDisconnect(EndpointREf ref);
C++ INTERFACE
OSStatus TEndpoint::RcvOrderlyDisconnect();
PARAMETERS
ref
The endpoint reference of the endpoint acknowledging receipt of the disconnect request.
DESCRIPTION
The OTRcvOrderlyDisconnect function is a service that is not supported by all protocols. If it is, the servtype field of the TEndpointInfo structure has the value T_COTS_ORD or T_TRANS_ORD for the endpoint.

After using the OTRcvOrderlyDisconnect function to acknowledge receipt of a disconnection request, there will not be any more data to receive. Calls to the OTRcv function (for a transactionless connection) or to the OTRcvRequest function (for a transaction-based connection) after acknowledging a disconnection request fail with the kOTOutStateErr result. If the endpoint supports a remote orderly disconnect, you can still send data over the connection if you have not yet called the OTSndOrderlyDisconnect function.

The OTRcvOrderlyDisconnect function behaves in the same way in all modes of operation. If there is no disconnection request pending, the function returns with the kOTNoReleaseErr result. It there is a disconnection request pending, the function returns either the kOTNoError or kOTBufferOverflowErr result. In the latter instance, you need to check the discon field of the TEndpointInfo structure for your endpoint and make sure that the buffer referenced by the udata.buf field is at least as big as the value specified for the discon field.

VALID STATES
T_DATAXFER, T_OUTREL

SEE ALSO
You use the OTSndOrderlyDisconnect function (page 3-153) to send an orderly disconnect.

For information on abortive and orderly disconnects see "Terminating a Connection," beginning on page 3-30.

You examine the TEndpointInfo structure (page 3-48) to determine whether the endpoint supports orderly release.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996